import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_module/common/widget/refresh/custom_refresh_header.dart';

/// Create by kyluzoi
/// Date: 2021-08-18
///
/// Description:

mixin ListBehavior {
  createEasyRefresh(Widget child, {controller}) {
    return EasyRefresh(
      child: child,
      onRefresh: onRefresh,
      onLoad: onLoad,
      header: refreshHeader,
      footer: refreshFooter,
      controller: controller,

      enableControlFinishRefresh: true,
      enableControlFinishLoad: true,
    );
  }

  OnRefreshCallback get onRefresh;

  OnRefreshCallback get onLoad;

  get refreshHeader => CustomRefreshHeader();

  get refreshFooter => BallPulseFooter();
}
